package poc;

import org.docx4j.wml.R;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Text;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.util.List;

/**
 * Created by zhangleilei on 2018/10/15.
 */
public class RunResolver {
    public static Document  ToDocument(List<Object> runs){
        try {
            //得到DOM解析器的工厂实例
            DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
            //从DOM工厂中获得DOM解析器
            DocumentBuilder dbBuilder = dbFactory.newDocumentBuilder();
            //创建文档树模型对象
            Document doc = dbBuilder.newDocument();

            for (Object obj:runs){
//                R run =(R)obj;
//                Element span = doc.createElement("span");
//                doc.appendChild(span);
            }


            return doc;
        }catch (Exception e){
            throw new RuntimeException(e);
        }
    }
}
